<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label for="c-category_id" class="control-label col-xs-12 col-sm-2">{:__('Category name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-category_id" data-rule="required" class="form-control selectpicker" name="row[category_id]">
                {foreach name="options" item="vo"}
                    <option value="{$vo['id']}" {if($vo.id == $row.category_id)}selected{/if}>{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" class="form-control" name="row[name]" type="text" value="{$row.name}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-paytype" class="control-label col-xs-12 col-sm-2">{:__('Paytype')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select  id="c-paytype" class="form-control selectpicker" name="row[paytype]">
                {foreach name="payTypeList" item="vo"}
                    <option value="{$key}" {if($key == $row.paytype)}selected{/if}>{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-type" class="form-control selectpicker" name="row[type]">
                {foreach name="typeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_radios('row[status]', [ 1=> __('depot'), 2 => __('selling')], $row['status'])}
        </div>
    </div>

    <div class="form-group">
        <label for="c-thumb" class="control-label col-xs-12 col-sm-2">{:__('Thumb')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" readonly class="form-control" size="50" name="row[thumb]" type="text" value="{$row.thumb}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview images" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-pics" class="control-label col-xs-12 col-sm-2">{:__('Pics')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input readonly id="c-pics" class="form-control" size="50" name="row[pics]" type="text" value="{$row.pics}">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-pics" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-pics"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-pics" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-pics"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-pics"></ul>
        </div>
    </div>
    <div class="form-group">
        <label for="c-weigh" class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" min="0" name="row[weigh]" type="number" value="{$row.weigh}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-weigh" class="control-label col-xs-12 col-sm-2">{:__('限购')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-max_buy_number" class="form-control" min="0" name="row[max_buy_number]" type="number" min="-1" value="{$row.max_buy_number}">
            <span class="text-danger">提示：-1为不限</span>
        </div>
    </div>
    <div class="form-group">
        <label for="c-stock" class="control-label col-xs-12 col-sm-2">{:__('Stock')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-stock" class="form-control" min="0" name="row[stock]" type="number" value="{$row.stock}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-scoreprice" class="control-label col-xs-12 col-sm-2">{:__('Scoreprice')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-scoreprice" class="form-control" min="0" name="row[scoreprice]" type="number" value="{$row.scoreprice}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-firsttime" class="control-label col-xs-12 col-sm-2">{:__('Firsttime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-firsttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[firsttime]" type="text" value="{$row.firsttime|datetime}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-lasttime" class="control-label col-xs-12 col-sm-2">{:__('Lasttime')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-lasttime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[lasttime]" type="text" value="{$row.lasttime|datetime}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-money" class="control-label col-xs-12 col-sm-2">{:__('Money')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-money" class="form-control" min="0" step="0.01" name="row[money]" type="number" value="{$row.money}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-usenum" class="control-label col-xs-12 col-sm-2">{:__('Usenum')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-usenum" class="form-control" min="0" name="row[usenum]" type="number" value="{$row.usenum}">
        </div>
    </div>
    <div class="form-group">
        <label for="c-flag" class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-flag" class="form-control selectpicker" multiple="" name="row[flag][]">
                {foreach name="flagList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.flag"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>

    <div class="form-group">
        <label for="c-rule" class="control-label col-xs-12 col-sm-2">{:__('Rule')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-rule" class="form-control editor" rows="5" name="row[rule]" cols="50">{$row.rule}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="c-body" class="control-label col-xs-12 col-sm-2">{:__('Body')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-body" class="form-control editor" rows="5" name="row[body]" cols="50">{$row.body}</textarea>
        </div>
    </div>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
